package com.human.service.impl;

import com.human.entity.Dept;
import com.human.dao.DeptMapper;
import com.human.entity.ResultVo;
import com.human.service.IDeptService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 部门 服务实现类
 * </p>
 *
 * @author jzq
 * @since 2023-02-28
 */
@Service
public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements IDeptService {

    @Resource
    DeptMapper deptMapper;

    @Override
    public ResultVo<Dept> getAllDept() {
        List<Dept> deptList = deptMapper.selectList(null);
        return new ResultVo<>(true, "查询成功", deptList);
    }

    @Override
    public ResultVo<List> getDeptAndPos() {
        List<Dept> deptAndPos = deptMapper.getDeptAndPos();
        return new ResultVo<>(true, "查询成功", deptAndPos);
    }

    @Override
    public ResultVo getDeptPersonNum() {
        List<Dept> deptPersonNum = deptMapper.getDeptPersonNum();
        return new ResultVo(true, "查询成功", deptPersonNum);
    }

}
